package com.moon;

/**
 * @author ：xxx
 * @description：TODO
 * @date ：2024/04/10 15:01
 */

import com.moon.handler.BookHandler;
import com.moon.repository.BookRepository;
import com.moon.repository.impl.InMemoryBookRepository;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class WebFluxDemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(WebFluxDemoApplication.class, args);
    }

    @Bean
    public BookRepository bookRepository() {
        return new InMemoryBookRepository();
    }

    @Bean
    public BookHandler bookHandler(BookRepository bookRepository) {
        return new BookHandler(bookRepository);
    }
}
